#include <riscv/block.h>

namespace riscv {
  Block::Block(int index) {
    this->name = std::string(".B") + std::to_string(index);
  }

  Block::Block(std::string _name): name(_name) {}

  Block::~Block() {
    for(Inst * inst : this->inst_list) {
      delete inst;
      inst = nullptr;
    }
    this->inst_list.clear();
  }

  std::string Block::get_name() {
    return this->name;
  }
}
